home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / osi / isode / dosisode / DOSISODE80.ZIP / ISODE8.WRK / PEPY / LEX.C_N next >
Encoding:
Text File  |  1992-06-28  |  20.5 KB  |  984 lines

  1. # include "stdio.h"
  2. # define U(x) x
  3. # define NLSTATE yyprevious=YYNEWLINE
  4. # define BEGIN yybgin = yysvec + 1 +
  5. # define INITIAL 0
  6. # define YYLERR yysvec
  7. # define YYSTATE (yyestate-yysvec-1)
  8. # define YYOPTIM 1
  9. # define YYLMAX BUFSIZ
  10. # define output(c) putc(c,yyout)
  11. # define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
  12. # define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
  13. # define yymore() (yymorfg=1)
  14. # define ECHO fprintf(yyout, "%s",yytext)
  15. # define REJECT { nstr = yyreject(); goto yyfussy;}
  16. int yyleng; extern char yytext[];
  17. int yymorfg;
  18. extern char *yysptr, yysbuf[];
  19. int yytchar;
  20. FILE *yyin = {stdin}, *yyout = {stdout};
  21. extern int yylineno;
  22. struct yysvf { 
  23.     struct yywork *yystoff;
  24.     struct yysvf *yyother;
  25.     int *yystops;};
  26. struct yysvf *yyestate;
  27. extern struct yysvf yysvec[], *yybgin;
  28. #ifndef    lint
  29. static char *RCSid = "$Header: /xtel/isode/isode/pepy/RCS/lex.l.gnrc,v 9.0 1992/06/16 12:25:01 isode Rel $";
  30. #endif
  31.  
  32. /* 
  33.  * $Header: /xtel/isode/isode/pepy/RCS/lex.l.gnrc,v 9.0 1992/06/16 12:25:01 isode Rel $
  34.  *
  35.  *
  36.  * $Log: lex.l.gnrc,v $
  37.  * Revision 9.0  1992/06/16  12:25:01  isode
  38.  * Release 8.0
  39.  *
  40.  */
  41.  
  42. /*
  43.  *                  NOTICE
  44.  *
  45.  *    Acquisition, use, and distribution of this module and related
  46.  *    materials are subject to the restrictions of a license agreement.
  47.  *    Consult the Preface in the User's Manual for the full terms of
  48.  *    this agreement.
  49.  *
  50.  *
  51.  */
  52.  
  53.  
  54. struct table {
  55.     char   *t_keyword;
  56.     int        t_value;
  57.     int        t_porting;
  58. };
  59.  
  60. static struct table reserved[] = {
  61.     "ABSENT", ABSENT, 0,
  62.     "ANY", ANY, 0,
  63.     "APPLICATION", APPLICATION, 0,
  64.     "BEGIN", BGIN, 0,
  65.     "BIT", BIT, 0,
  66.     "BITSTRING", BITSTRING, 0,
  67.     "BOOLEAN", BOOLEAN, 0,
  68.     "BY", BY, 0,
  69.     "CHOICE", CHOICE, 0,
  70.     "COMPONENT", COMPONENT, 0,
  71.     "COMPONENTS", COMPONENTS, 0,
  72.     "COMPONENTSOF", COMPONENTSOF, 0,
  73.     "DECODER", DECODER, 0,
  74.     "DEFAULT", DEFAULT, 0,
  75.     "DEFINED", DEFINED, 0,
  76.     "DEFINITIONS", DEFINITIONS, 0,
  77.     "ENCODER", ENCODER, 0,
  78.     "ENCRYPTED", ENCRYPTED, 0,
  79.     "END", END, 0,
  80.     "ENUMERATED", ENUMERATED, 0,
  81.     "EXPLICIT", EXPLICIT, 0,
  82.     "EXPORTS", EXPORTS, 0,
  83.     "FALSE", L_FALSE, 0,
  84.     "FROM", FROM, 0,
  85.     "IDENTIFIER", IDENTIFIER, 0,
  86.     "IMPLICIT", IMPLICIT, 0,
  87.     "IMPORTS", IMPORTS, 0,
  88.     "INCLUDE", INCLUDES, 0,
  89.     "INTEGER", INTEGER, 0,
  90.     "MIN", MIN, 0,
  91.     "MAX", MAX, 0,
  92.     "NULL", NIL, 0,
  93.     "OBJECT", OBJECT, 0,
  94.     "OCTET", OCTET, 0,
  95.     "OCTETSTRING", OCTETSTRING, 0,
  96.     "OF", OF, 0,
  97.     "OPTIONAL", OPTIONAL, 0,
  98.     "PREFIXES", PREFIXES, 0,
  99.     "PRESENT", PRESENT, 0,
  100.     "PRINTER", PRINTER, 0,
  101.     "PRIVATE", PRIVATE, 0,
  102.     "REAL", REAL, 0,
  103.     "SECTIONS", SECTIONS, 0,
  104.     "SEQUENCE", SEQUENCE, 0,
  105.     "SEQUENCEOF", SEQUENCEOF, 0,
  106.     "SET", SET, 0,
  107.     "SETOF", SETOF, 0,
  108.     "SIZE", SIZE, 0,
  109.     "STRING", STRING, 0,
  110.     "TAGS", TAGS, 0,
  111.     "TRUE", L_TRUE, 0,
  112.     "UNIVERSAL", UNIVERSAL, 0,
  113.     "WITH", WITH, 0,
  114.     "PLUS-INFINITY", PLUSINFINITY, 0,
  115.     "MINUS-INFINITY", MINUSINFINITY, 0,
  116.     NULL, 0
  117. };
  118. # define YYNEWLINE 10
  119. yylex(){
  120. int nstr; extern int yyprevious;
  121. while((nstr = yylook()) >= 0)
  122. yyfussy: switch(nstr){
  123. case 0:
  124. if(yywrap()) return(0); break;
  125. case 1:
  126.         {   register int c, d;
  127.  
  128.                 for (d = 0; c = input (); d = c == '-')
  129.                 if (c == '\n' || (d && c == '-'))
  130.                     break;
  131.             }
  132. break;
  133. case 2:
  134.         {
  135.                 if (yydebug)
  136.                 fprintf (stderr, "WT\n");
  137.             }
  138. break;
  139. case 3:
  140.         {
  141.                 if (yydebug)
  142.                 fprintf (stderr, "NL\n");
  143.             }
  144. break;
  145. case 4:
  146.         {
  147.                 if (yydebug)
  148.                 fprintf (stderr, "SY: CCE\n");
  149.                 return CCE;
  150.             }
  151. break;
  152. case 5:
  153.         {
  154.                 if (yydebug)
  155.                     fprintf (stderr, "SY: DOTDOTDOT\n");
  156.                 return DOTDOTDOT;
  157.             }
  158. break;
  159. case 6:
  160.         {
  161.                     if (yydebug)
  162.                 fprintf (stderr, "SY: DOTDOT\n");
  163.                 return DOTDOT;
  164.             }
  165. break;
  166. case 7:
  167.         {
  168.                 if (yydebug)
  169.                 fprintf (stderr, "SY: DOT\n");
  170.                 return DOT;
  171.             }
  172. break;
  173. case 8:
  174.         {
  175.                 if (yydebug)
  176.                 fprintf (stderr, "SY: SEMICOLON");
  177.                 return SEMICOLON;
  178.             }
  179. break;
  180. case 9:
  181.         {
  182.                 if (yydebug)
  183.                 fprintf (stderr, "SY: COMMA\n");
  184.                 return COMMA;
  185.             }
  186. break;
  187. case 10:
  188.         {
  189.                 if (yydebug)
  190.                 fprintf (stderr, "SY: LBRACE\n");
  191.                 return LBRACE;
  192.             }
  193. break;
  194. case 11:
  195.         {
  196.                 if (yydebug)
  197.                 fprintf (stderr, "SY: RBRACE\n");
  198.                 return RBRACE;
  199.             }
  200. break;
  201. case 12:
  202.         {
  203.                 if (yydebug)
  204.                 fprintf (stderr, "SY: BAR\n");
  205.                 return BAR;
  206.             }
  207. break;
  208. case 13:
  209.     {   register int tok, c, d, len;
  210.                 register char *cp, *ep, *pp;
  211.  
  212.                 if (*yytext == '$')
  213.                 tok = VLENGTH;
  214.                 else
  215.                 if (*yytext == '<')
  216.                     tok = CONTROL;
  217.                 else {
  218.                     while((c = input()) == ' ' || c =='\t')
  219.                         continue;
  220.                     switch (c) {
  221.                     case 'a': tok = VALA;
  222.                           break;
  223.                     case 'b': tok = VALB;
  224.                           break;
  225.                     case 'i': tok = VALI;
  226.                           break;
  227.                     case 's': tok = VALS;
  228.                           break;
  229.                     case 'o': tok = VALO;
  230.                           break;
  231.                     case 'x': tok = VALX;
  232.                           break;
  233.                     case 'p': tok = VALP;
  234.                           break;
  235.                     case 'q': tok = VALQ;
  236.                               break;
  237.                     case 'r': tok = VALR;
  238.                           break;
  239.                     case 'O': tok = VALOID;
  240.                           break;
  241.                     case 'P': tok = PARAMETERTYPE;
  242.                               break;
  243.                     default : myyerror ("unknown token: \"%s\"", yytext);
  244.                           break;
  245.                     }
  246.                     if ((c = input()) != ' ' && c != '\t'
  247.                     && c != '\n')
  248.                     yyerror ("syntax error in [[ ... ]]");
  249.                 }
  250.  
  251.                 if ((pp = malloc ((unsigned) (len = BUFSIZ)))
  252.                     == NULL)
  253.                 yyerror ("out of memory");
  254.  
  255.                 for (ep = (cp = pp) + len - 1, d = NULL;; d = c) {
  256.                 if ((c = input ()) == NULL)
  257.                     yyerror ("end-of-file while reading value");
  258.                 if ((d == ']' && c == ']' && tok !=CONTROL) ||
  259.                     (c == '$' && (tok ==VALX || tok ==VALO)) ||
  260.                     (d == '>' && c == '>' && tok ==CONTROL)) {
  261.                     if ((tok == VALX || tok == VALO) &&
  262.                        (c != '$'))
  263.                        yyerror("Missing '$' in [[ - ]]");
  264.                     if (c == '$') {unput(c); *cp = NULL;}
  265.                     else *--cp = NULL;
  266.                     yylval.yy_string = pp;
  267.                     if (yydebug)
  268.                     fprintf (stderr, "VAL: \"%s\"\n",
  269.                         yylval.yy_string);
  270.                     return tok;
  271.                 }
  272.                 if (cp >= ep) {
  273.                     register int curlen = cp - pp;
  274.                     register char *dp;
  275.  
  276.                     if ((dp = realloc (pp,
  277.                         (unsigned) (len += BUFSIZ)))
  278.                         == NULL)
  279.                     yyerror ("out of memory");
  280.                     cp = dp + curlen;
  281.                     ep = (pp = dp) + len - 1;
  282.                 }
  283.                 *cp++ = c;
  284.                 }
  285.             }
  286. break;
  287. case 14:
  288.         {
  289.                 if (yydebug)
  290.                 fprintf (stderr, "SY: LBRACKET\n");
  291.                 return LBRACKET;
  292.             }
  293. break;
  294. case 15:
  295.         {
  296.                 if (yydebug)
  297.                 fprintf (stderr, "SY: RBRACKET\n");
  298.                 return RBRACKET;
  299.             }
  300. break;
  301. case 16:
  302.         {
  303.                 if (yydebug)
  304.                 fprintf (stderr, "SY: LANGLE\n");
  305.                 return LANGLE;
  306.             }
  307. break;
  308. case 17:
  309.         {
  310.                 if (yydebug)
  311.                 fprintf (stderr, "SY: LPAREN\n");
  312.                 return LPAREN;
  313.             }
  314. break;
  315. case 18:
  316.         {
  317.                 if (yydebug)
  318.                 fprintf (stderr, "SY: RPAREN\n");
  319.                 return RPAREN;
  320.             }
  321. break;
  322. case 19:
  323.         {
  324.                 (void) sscanf (yytext, "%d", &yylval.yy_number);
  325.                 if (yydebug)
  326.                 fprintf (stderr, "LIT: 0x%x\n", yylval.yy_number);
  327.                 return LITNUMBER;
  328.             }
  329. break;
  330. case 20:
  331.         {
  332.                 (void) sscanf (yytext, "%d", &yylval.yy_number);
  333.                 if (yydebug)
  334.                 fprintf (stderr, "LIT: 0x%x\n", yylval.yy_number);
  335.                 return LITNUMBER;
  336.             }
  337. break;
  338. case 21:
  339.     {   register char *cp; register int i;
  340.  
  341.                 switch (*(cp = yytext + strlen (yytext) - 1)) {
  342.                 case 'H':
  343.                 case 'h':
  344.                     *cp = NULL;
  345.                     (void) sscanf (yytext + 1, "%x",
  346.                         &yylval.yy_number);
  347.                     break;
  348.  
  349.                 case 'B':
  350.                 case 'b':
  351.                     *cp-- = NULL, *cp = NULL;
  352.                     for (i = 0, cp = yytext + 1; *cp; ) {
  353.                     i <<= 1;
  354.                     i += *cp++ - '0';
  355.                     }
  356.                     yylval.yy_number = i;
  357.                     break; 
  358.                 }
  359.                 if (yydebug)
  360.                 fprintf (stderr, "LIT: 0x%x\n", yylval.yy_number);
  361.                 return LITNUMBER;
  362.             }
  363. break;
  364. case 22:
  365.         {
  366.                 int        c, len;
  367.                 register char *cp, *ep, *pp;
  368.  
  369.                 if ((pp = malloc ((unsigned) (len = BUFSIZ)))
  370.                     == NULL)
  371.                 yyerror ("out of memory");
  372.  
  373.                 for (ep = (cp = pp) + len - 1;;) {
  374.                 if ((c = input ()) == NULL)
  375.                     yyerror ("end-of-file while reading string");
  376.                 if (c == '"')
  377.                     break;
  378.  
  379.                 if (cp >= ep) {
  380.                     register int curlen = cp - pp;
  381.                     register char *dp;
  382.  
  383.                     if ((dp = realloc (pp,
  384.                                (unsigned) (len += BUFSIZ)))
  385.                         == NULL)
  386.                     yyerror ("out of memory");
  387.                     cp = dp + curlen;
  388.                     ep = (pp = dp) + len - 1;
  389.                 }
  390.                 *cp++ = c;
  391.                 }
  392.                 *cp = NULL;
  393.                 yylval.yy_string = pp;
  394.                 if (yydebug)
  395.                 fprintf (stderr, "LIT: \"%s\"\n",
  396.                      yylval.yy_string);
  397.                 return LITSTRING;
  398.             }
  399. break;
  400. case 23:
  401. {   register struct table *t;
  402.  
  403.                 for (t = reserved; t -> t_keyword; t++)
  404.                 if (strcmp (t -> t_keyword, yytext) == 0) {
  405.                     if (yyporting && t -> t_porting)
  406.                     break;
  407.                     if (yydebug)
  408.                     fprintf (stderr,
  409.                           "KE: \"%s\"\n", yytext);
  410.                     return t -> t_value;
  411.                 }
  412.                 yylval.yy_string = new_string (yytext);
  413.                 if (yydebug)
  414.                 fprintf (stderr, "ID: \"%s\"\n", yylval.yy_string);
  415.                 return ID;
  416.             }
  417. break;
  418. case 24:
  419. {   yylval.yy_string = new_string (yytext);
  420.                 if (yydebug)
  421.                 fprintf (stderr, "NAME: \"%s\"\n", yylval.yy_string);
  422.                 return NAME;
  423.             }
  424. break;
  425. case 25:
  426.         {   register int c, d, len;
  427.                 register char *cp, *ep, *pp;
  428.  
  429.                 if ((pp = malloc ((unsigned) (len = BUFSIZ)))
  430.                     == NULL)
  431.                 yyerror ("out of memory");
  432.  
  433.                 for (ep = (cp = pp) + len - 1, d = NULL;; d = c) {
  434.                 if ((c = input ()) == NULL)
  435.                     yyerror ("end-of-file while reading value");
  436.                 if (d == '%' && c == ']' ) {
  437.                     *--cp = NULL;
  438.                     yylval.yy_string = pp;
  439.                     if (yydebug)
  440.                     fprintf (stderr, "VAL: \"%s\"\n",
  441.                          yylval.yy_string);
  442.                     return SCTRL;
  443.                 }
  444.                 if (d == '\n')
  445.                     yyerror ("newline in %[ %] construct");
  446.                 if (cp >= ep) {
  447.                     register int curlen = cp - pp;
  448.                     register char *dp;
  449.  
  450.                     if ((dp = realloc (pp,
  451.                         (unsigned) (len += BUFSIZ)))
  452.                         == NULL)
  453.                     yyerror ("out of memory");
  454.                     cp = dp + curlen;
  455.                     ep = (pp = dp) + len - 1;
  456.                 }
  457.                 *cp++ = c;
  458.                 }
  459.             }
  460. break;
  461. case 26:
  462.         {   register int c, d, len;
  463.                 int        mylineno;
  464.                 register char *cp, *ep, *pp;
  465.  
  466.                 mylineno = yylineno;
  467.                 if ((pp = malloc ((unsigned) (len = BUFSIZ)))
  468.                     == NULL)
  469.                 yyerror ("out of memory");
  470.  
  471.                 for (ep = (cp = pp) + len - 1, d = NULL;; d = c) {
  472.                 if ((c = input ()) == NULL)
  473.                     yyerror ("end-of-file while reading action");
  474.                 if (d == '%' && c == '}') {
  475.                     *--cp = NULL;
  476.                     yylval.yy_action = new_action (pp, mylineno);;
  477.                     if (yydebug)
  478.                     fprintf (stderr, "ACTION: \"%s\", %d\n",
  479.                         yylval.yy_action -> ya_text,
  480.                         yylval.yy_action -> ya_lineno);
  481.                     return ACTION;
  482.                 }
  483.                 if (cp >= ep) {
  484.                     register int curlen = cp - pp;
  485.                     register char *dp;
  486.  
  487.                     if ((dp = realloc (pp,
  488.                         (unsigned) (len += BUFSIZ)))
  489.                         == NULL)
  490.                     yyerror ("out of memory");
  491.                     cp = dp + curlen;
  492.                     ep = (pp = dp) + len - 1;
  493.                 }
  494.                 *cp++ = c;
  495.                 }
  496.             }
  497. break;
  498. case 27:
  499.         {   
  500.                 myyerror ("unknown token: \"%s\"", yytext);
  501.             }
  502. break;
  503. case -1:
  504. break;
  505. default:
  506. fprintf(yyout,"bad switch yylook %d",nstr);
  507. } return(0); }
  508. /* end of yylex */
  509. int yyvstop[] = {
  510. 0,
  511.  
  512. 2,
  513. 0,
  514.  
  515. 2,
  516. 0,
  517.  
  518. 27,
  519. 0,
  520.  
  521. 2,
  522. 27,
  523. 0,
  524.  
  525. 3,
  526. 0,
  527.  
  528. 22,
  529. 27,
  530. 0,
  531.  
  532. 13,
  533. 27,
  534. 0,
  535.  
  536. 27,
  537. 0,
  538.  
  539. 27,
  540. 0,
  541.  
  542. 17,
  543. 27,
  544. 0,
  545.  
  546. 18,
  547. 27,
  548. 0,
  549.  
  550. 9,
  551. 27,
  552. 0,
  553.  
  554. 27,
  555. 0,
  556.  
  557. 7,
  558. 27,
  559. 0,
  560.  
  561. 19,
  562. 27,
  563. 0,
  564.  
  565. 27,
  566. 0,
  567.  
  568. 8,
  569. 27,
  570. 0,
  571.  
  572. 16,
  573. 27,
  574. 0,
  575.  
  576. 23,
  577. 27,
  578. 0,
  579.  
  580. 14,
  581. 27,
  582. 0,
  583.  
  584. 15,
  585. 27,
  586. 0,
  587.  
  588. 24,
  589. 27,
  590. 0,
  591.  
  592. 10,
  593. 27,
  594. 0,
  595.  
  596. 12,
  597. 27,
  598. 0,
  599.  
  600. 11,
  601. 27,
  602. 0,
  603.  
  604. 2,
  605. 0,
  606.  
  607. 25,
  608. 0,
  609.  
  610. 26,
  611. 0,
  612.  
  613. 1,
  614. 0,
  615.  
  616. 20,
  617. 0,
  618.  
  619. 6,
  620. 0,
  621.  
  622. 19,
  623. 0,
  624.  
  625. 13,
  626. 0,
  627.  
  628. 23,
  629. 0,
  630.  
  631. 24,
  632. 0,
  633.  
  634. 21,
  635. 0,
  636.  
  637. 5,
  638. 0,
  639.  
  640. 4,
  641. 0,
  642. 0};
  643. # define YYTYPE char
  644. struct yywork { YYTYPE verify, advance; } yycrank[] = {
  645. 0,0,    0,0,    1,3,    0,0,    
  646. 0,0,    0,0,    0,0,    0,0,    
  647. 0,0,    0,0,    1,4,    1,5,    
  648. 0,0,    4,26,    0,0,    0,0,    
  649. 0,0,    0,0,    0,0,    0,0,    
  650. 0,0,    0,0,    0,0,    0,0,    
  651. 0,0,    0,0,    0,0,    0,0,    
  652. 0,0,    0,0,    0,0,    0,0,    
  653. 0,0,    0,0,    0,0,    1,6,    
  654. 4,26,    1,7,    1,8,    0,0,    
  655. 1,9,    1,10,    1,11,    0,0,    
  656. 9,29,    1,12,    1,13,    1,14,    
  657. 14,33,    1,15,    33,40,    29,0,    
  658. 9,29,    9,29,    29,30,    0,0,    
  659. 0,0,    0,0,    0,0,    1,16,    
  660. 1,17,    1,18,    16,35,    18,36,    
  661. 35,41,    0,0,    1,19,    1,19,    
  662. 0,0,    0,0,    0,0,    2,6,    
  663. 0,0,    0,0,    2,8,    0,0,    
  664. 2,9,    2,10,    2,11,    9,0,    
  665. 0,0,    2,12,    9,30,    2,14,    
  666. 0,0,    0,0,    0,0,    0,0,    
  667. 9,29,    0,0,    0,0,    9,29,    
  668. 1,20,    20,36,    1,21,    2,16,    
  669. 2,17,    2,18,    1,22,    1,22,    
  670. 8,27,    0,0,    0,0,    0,0,    
  671. 0,0,    0,0,    0,0,    13,31,    
  672. 9,29,    9,29,    13,32,    13,32,    
  673. 13,32,    13,32,    13,32,    13,32,    
  674. 13,32,    13,32,    13,32,    13,32,    
  675. 0,0,    30,39,    0,0,    0,0,    
  676. 1,23,    1,24,    1,25,    30,39,    
  677. 2,20,    0,0,    2,21,    0,0,    
  678. 8,28,    0,0,    0,0,    0,0,    
  679. 0,0,    0,0,    0,0,    0,0,    
  680. 9,29,    9,29,    15,34,    15,34,    
  681. 15,34,    15,34,    15,34,    15,34,    
  682. 15,34,    15,34,    15,34,    15,34,    
  683. 0,0,    30,39,    0,0,    0,0,    
  684. 0,0,    0,0,    0,0,    30,39,    
  685. 2,23,    2,24,    2,25,    19,37,    
  686. 0,0,    0,0,    19,37,    19,37,    
  687. 19,37,    19,37,    19,37,    19,37,    
  688. 19,37,    19,37,    19,37,    19,37,    
  689. 0,0,    0,0,    0,0,    0,0,    
  690. 0,0,    0,0,    0,0,    19,37,    
  691. 19,37,    19,37,    19,37,    19,37,    
  692. 19,37,    19,37,    19,37,    19,37,    
  693. 19,37,    19,37,    19,37,    19,37,    
  694. 19,37,    19,37,    19,37,    19,37,    
  695. 19,37,    19,37,    19,37,    19,37,    
  696. 19,37,    19,37,    19,37,    19,37,    
  697. 19,37,    0,0,    0,0,    0,0,    
  698. 0,0,    0,0,    0,0,    19,37,    
  699. 19,37,    19,37,    19,37,    19,37,    
  700. 19,37,    19,37,    19,37,    19,37,    
  701. 19,37,    19,37,    19,37,    19,37,    
  702. 19,37,    19,37,    19,37,    19,37,    
  703. 19,37,    19,37,    19,37,    19,37,    
  704. 19,37,    19,37,    19,37,    19,37,    
  705. 19,37,    22,38,    0,0,    0,0,    
  706. 22,38,    22,38,    22,38,    22,38,    
  707. 22,38,    22,38,    22,38,    22,38,    
  708. 22,38,    22,38,    0,0,    0,0,    
  709. 0,0,    0,0,    0,0,    0,0,    
  710. 0,0,    22,38,    22,38,    22,38,    
  711. 22,38,    22,38,    22,38,    22,38,    
  712. 22,38,    22,38,    22,38,    22,38,    
  713. 22,38,    22,38,    22,38,    22,38,    
  714. 22,38,    22,38,    22,38,    22,38,    
  715. 22,38,    22,38,    22,38,    22,38,    
  716. 22,38,    22,38,    22,38,    0,0,    
  717. 0,0,    0,0,    0,0,    0,0,    
  718. 0,0,    22,38,    22,38,    22,38,    
  719. 22,38,    22,38,    22,38,    22,38,    
  720. 22,38,    22,38,    22,38,    22,38,    
  721. 22,38,    22,38,    22,38,    22,38,    
  722. 22,38,    22,38,    22,38,    22,38,    
  723. 22,38,    22,38,    22,38,    22,38,    
  724. 22,38,    22,38,    22,38,    32,32,    
  725. 32,32,    32,32,    32,32,    32,32,    
  726. 32,32,    32,32,    32,32,    32,32,    
  727. 32,32,    0,0,    0,0,    0,0,    
  728. 0,0};
  729. struct yysvf yysvec[] = {
  730. 0,    0,    0,
  731. yycrank+-1,    0,        yyvstop+1,
  732. yycrank+-37,    yysvec+1,    yyvstop+3,
  733. yycrank+0,    0,        yyvstop+5,
  734. yycrank+4,    0,        yyvstop+7,
  735. yycrank+0,    0,        yyvstop+10,
  736. yycrank+0,    0,        yyvstop+12,
  737. yycrank+0,    0,        yyvstop+15,
  738. yycrank+9,    0,        yyvstop+18,
  739. yycrank+-43,    0,        yyvstop+20,
  740. yycrank+0,    0,        yyvstop+22,
  741. yycrank+0,    0,        yyvstop+25,
  742. yycrank+0,    0,        yyvstop+28,
  743. yycrank+62,    0,        yyvstop+31,
  744. yycrank+2,    0,        yyvstop+33,
  745. yycrank+94,    0,        yyvstop+36,
  746. yycrank+4,    0,        yyvstop+39,
  747. yycrank+0,    0,        yyvstop+41,
  748. yycrank+3,    0,        yyvstop+44,
  749. yycrank+118,    0,        yyvstop+47,
  750. yycrank+2,    0,        yyvstop+50,
  751. yycrank+0,    0,        yyvstop+53,
  752. yycrank+196,    0,        yyvstop+56,
  753. yycrank+0,    0,        yyvstop+59,
  754. yycrank+0,    0,        yyvstop+62,
  755. yycrank+0,    0,        yyvstop+65,
  756. yycrank+0,    yysvec+4,    yyvstop+68,
  757. yycrank+0,    0,        yyvstop+70,
  758. yycrank+0,    0,        yyvstop+72,
  759. yycrank+-15,    yysvec+9,    0,    
  760. yycrank+55,    0,        0,    
  761. yycrank+0,    0,        yyvstop+74,
  762. yycrank+271,    0,        yyvstop+76,
  763. yycrank+4,    0,        yyvstop+78,
  764. yycrank+0,    yysvec+15,    yyvstop+80,
  765. yycrank+3,    0,        0,    
  766. yycrank+0,    0,        yyvstop+82,
  767. yycrank+0,    yysvec+19,    yyvstop+84,
  768. yycrank+0,    yysvec+22,    yyvstop+86,
  769. yycrank+0,    0,        yyvstop+88,
  770. yycrank+0,    0,        yyvstop+90,
  771. yycrank+0,    0,        yyvstop+92,
  772. 0,    0,    0};
  773. struct yywork *yytop = yycrank+328;
  774. struct yysvf *yybgin = yysvec+1;
  775. char yymatch[] = {
  776. 00  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  777. 01  ,011 ,012 ,01  ,01  ,01  ,01  ,01  ,
  778. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  779. 01  ,01  ,01  ,01  ,01  ,01  ,01  ,01  ,
  780. 011 ,01  ,01  ,01  ,'$' ,01  ,01  ,'$' ,
  781. 01  ,01  ,01  ,01  ,01  ,'-' ,01  ,01  ,
  782. '0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,
  783. '0' ,'0' ,01  ,01  ,01  ,01  ,01  ,01  ,
  784. 01  ,'A' ,'B' ,'A' ,'A' ,'A' ,'A' ,'A' ,
  785. 'B' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
  786. 'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,'A' ,
  787. 'A' ,'A' ,'A' ,01  ,01  ,01  ,01  ,01  ,
  788. 01  ,'a' ,'b' ,'a' ,'a' ,'a' ,'a' ,'a' ,
  789. 'b' ,'a' ,'a' ,'a' ,'a' ,'a' ,'a' ,'a' ,
  790. 'a' ,'a' ,'a' ,'a' ,'a' ,'a' ,'a' ,'a' ,
  791. 'a' ,'a' ,'a' ,01  ,01  ,01  ,01  ,01  ,
  792. 0};
  793. char yyextra[] = {
  794. 0,0,0,0,0,0,0,0,
  795. 0,0,0,0,0,0,0,0,
  796. 0,0,0,0,0,0,0,0,
  797. 0,0,0,0,0,0,0,0,
  798. 0};
  799. #ifndef lint
  800. static    char ncform_sccsid[] = "@(#)ncform 1.6 88/02/08 SMI"; /* from S5R2 1.2 */
  801. #endif
  802.  
  803. int yylineno =1;
  804. # define YYU(x) x
  805. # define NLSTATE yyprevious=YYNEWLINE
  806. char yytext[YYLMAX];
  807. struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
  808. char yysbuf[YYLMAX];
  809. char *yysptr = yysbuf;
  810. int *yyfnd;
  811. extern struct yysvf *yyestate;
  812. int yyprevious = YYNEWLINE;
  813. yylook(){
  814.     register struct yysvf *yystate, **lsp;
  815.     register struct yywork *yyt;
  816.     struct yysvf *yyz;
  817.     int yych, yyfirst;
  818.     struct yywork *yyr;
  819. # ifdef LEXDEBUG
  820.     int debug;
  821. # endif
  822.     char *yylastch;
  823.     /* start off machines */
  824. # ifdef LEXDEBUG
  825.     debug = 0;
  826. # endif
  827.     yyfirst=1;
  828.     if (!yymorfg)
  829.         yylastch = yytext;
  830.     else {
  831.         yymorfg=0;
  832.         yylastch = yytext+yyleng;
  833.         }
  834.     for(;;){
  835.         lsp = yylstate;
  836.         yyestate = yystate = yybgin;
  837.         if (yyprevious==YYNEWLINE) yystate++;
  838.         for (;;){
  839. # ifdef LEXDEBUG
  840.             if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
  841. # endif
  842.             yyt = yystate->yystoff;
  843.             if(yyt == yycrank && !yyfirst){  /* may not be any transitions */
  844.                 yyz = yystate->yyother;
  845.                 if(yyz == 0)break;
  846.                 if(yyz->yystoff == yycrank)break;
  847.                 }
  848.             *yylastch++ = yych = input();
  849.             yyfirst=0;
  850.         tryagain:
  851. # ifdef LEXDEBUG
  852.             if(debug){
  853.                 fprintf(yyout,"char ");
  854.                 allprint(yych);
  855.                 putchar('\n');
  856.                 }
  857. # endif
  858.             yyr = yyt;
  859.             if ( (int)yyt > (int)yycrank){
  860.                 yyt = yyr + yych;
  861.                 if (yyt <= yytop && yyt->verify+yysvec == yystate){
  862.                     if(yyt->advance+yysvec == YYLERR)    /* error transitions */
  863.                         {unput(*--yylastch);break;}
  864.                     *lsp++ = yystate = yyt->advance+yysvec;
  865.                     goto contin;
  866.                     }
  867.                 }
  868. # ifdef YYOPTIM
  869.             else if((int)yyt < (int)yycrank) {        /* r < yycrank */
  870.                 yyt = yyr = yycrank+(yycrank-yyt);
  871. # ifdef LEXDEBUG
  872.                 if(debug)fprintf(yyout,"compressed state\n");
  873. # endif
  874.                 yyt = yyt + yych;
  875.                 if(yyt <= yytop && yyt->verify+yysvec == yystate){
  876.                     if(yyt->advance+yysvec == YYLERR)    /* error transitions */
  877.                         {unput(*--yylastch);break;}
  878.                     *lsp++ = yystate = yyt->advance+yysvec;
  879.                     goto contin;
  880.                     }
  881.                 yyt = yyr + YYU(yymatch[yych]);
  882. # ifdef LEXDEBUG
  883.                 if(debug){
  884.                     fprintf(yyout,"try fall back character ");
  885.                     allprint(YYU(yymatch[yych]));
  886.                     putchar('\n');
  887.                     }
  888. # endif
  889.                 if(yyt <= yytop && yyt->verify+yysvec == yystate){
  890.                     if(yyt->advance+yysvec == YYLERR)    /* error transition */
  891.                         {unput(*--yylastch);break;}
  892.                     *lsp++ = yystate = yyt->advance+yysvec;
  893.                     goto contin;
  894.                     }
  895.                 }
  896.             if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
  897. # ifdef LEXDEBUG
  898.                 if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
  899. # endif
  900.                 goto tryagain;
  901.                 }
  902. # endif
  903.             else
  904.                 {unput(*--yylastch);break;}
  905.         contin:
  906. # ifdef LEXDEBUG
  907.             if(debug){
  908.                 fprintf(yyout,"state %d char ",yystate-yysvec-1);
  909.                 allprint(yych);
  910.                 putchar('\n');
  911.                 }
  912. # endif
  913.             ;
  914.             }
  915. # ifdef LEXDEBUG
  916.         if(debug){
  917.             fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
  918.             allprint(yych);
  919.             putchar('\n');
  920.             }
  921. # endif
  922.         while (lsp-- > yylstate){
  923.             *yylastch-- = 0;
  924.             if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
  925.                 yyolsp = lsp;
  926.                 if(yyextra[*yyfnd]){        /* must backup */
  927.                     while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
  928.                         lsp--;
  929.                         unput(*yylastch--);
  930.                         }
  931.                     }
  932.                 yyprevious = YYU(*yylastch);
  933.                 yylsp = lsp;
  934.                 yyleng = yylastch-yytext+1;
  935.                 yytext[yyleng] = 0;
  936. # ifdef LEXDEBUG
  937.                 if(debug){
  938.                     fprintf(yyout,"\nmatch ");
  939.                     sprint(yytext);
  940.                     fprintf(yyout," action %d\n",*yyfnd);
  941.                     }
  942. # endif
  943.                 return(*yyfnd++);
  944.                 }
  945.             unput(*yylastch);
  946.             }
  947.         if (yytext[0] == 0  /* && feof(yyin) */)
  948.             {
  949.             yysptr=yysbuf;
  950.             return(0);
  951.             }
  952.         yyprevious = yytext[0] = input();
  953.         if (yyprevious>0)
  954.             output(yyprevious);
  955.         yylastch=yytext;
  956. # ifdef LEXDEBUG
  957.         if(debug)putchar('\n');
  958. # endif
  959.         }
  960.     }
  961. yyback(p, m)
  962.     int *p;
  963. {
  964. if (p==0) return(0);
  965. while (*p)
  966.     {
  967.     if (*p++ == m)
  968.         return(1);
  969.     }
  970. return(0);
  971. }
  972.     /* the following are only used in the lex library */
  973. yyinput(){
  974.     return(input());
  975.     }
  976. yyoutput(c)
  977.   int c; {
  978.     output(c);
  979.     }
  980. yyunput(c)
  981.    int c; {
  982.     unput(c);
  983.     }
  984.